//banner1
    $(document).ready(function() {
    var index=0;
    var timer;
    var finish = false;
    var len = $(".sliderInner ul li").length;

    $(".sliderInner ul li").css('opacity',0);
    $(".sliderInner ul li").eq(index).css('opacity',1);
    $(".sliderCtr a").eq(index).addClass("active");
    $(".sliderCon a").eq(index).addClass("show1");

    $(".sliderCtr a").click(function(){
      index = $(".sliderCtr a").index(this);
      show(index);
    });

    $(".sliderCon a").click(function(){
      index = $(".sliderCon a").index(this);
      show(index);
    });

    function show(index){
      $(".sliderCtr a").eq(index).addClass("active");  //添加当前
      $(".sliderCon a").eq(index).addClass("show1");  //添加当前
      $(".sliderInner ul li").css({'opacity':0,'z-index':0}).eq(index).css({'opacity':1,'z-index':1});

      $(".sliderCtr a").removeClass("active")     //控制当前标签
              .eq(index).addClass("active");
      $(".sliderCon a").removeClass("show1")     //控制当前标签
              .eq(index).addClass("show1");
    }

    function autoplay(){
        timer = setInterval(function(){
          if(index == len-1){index = -1}      //点击后播放下一个  
          show(index+1)
          index++;
          if(index == len-1){index = -1}
        },4000);
    };
    $(".sliderCtr").hover(function(){  
        clearInterval(timer);               //删除自动播放
      },function(){
      autoplay();
      }).trigger("mouseleave");

    });




//艺术家风采
$(document).ready(
    function(){
        var nowshowpic = 0;
        var mytimer = null;
        //复制一个第一个li在最后，用于变魔术
        $(".photo-box ul li:eq(0)").clone().appendTo(".photo-box ul");
        dongdong();
        function dongdong(){
            window.clearInterval(mytimer);
            mytimer = window.setInterval(
                function(){
                    $(".photo-btn-r").trigger("click");
                },2500
            );
        }
        $(".photo").mouseenter(
            function(){
                window.clearInterval(mytimer)
            }
        );

        $(".photo").mouseleave(
            function(){
                dongdong();
            }
        );
        $(".photo-btn-r").click(
            function(){
                if(!$(".photo-box ul").is(":animated")){
                    if(nowshowpic == $(".photo-box ul li").length - 2){
                        nowshowpic = 0;
                        lunboxianshi2();
                    }else{
                        nowshowpic = nowshowpic + 1;
                        lunboxianshi(nowshowpic);
                    }
                }
            }
        );
        $(".photo-btn-l").click(
            function(){
                if(!$(".photo-box ul").is(":animated")){
                    if(nowshowpic == 0){
                        nowshowpic = $(".photo-box ul li").length - 2;
                        lunboxianshi3();
                    }else{
                        nowshowpic = nowshowpic - 1;
                        lunboxianshi(nowshowpic);
                    }
                    
                }
            }
        );
        function lunboxianshi(nowshowpic){
            console.log("已经进入到动画函数" + nowshowpic);
            $(".photo-box ul").animate(
                {
                    "left":-148 * nowshowpic
                },500
            );
        }
        function lunboxianshi2(){
            $(".photo-box ul").animate(
                {
                    "left":-148 * ($(".photo-box li").length - 1)
                },500,function(){
                    $(".photo-box ul").css("left",0);
                }
            );
        }
        function lunboxianshi3(){
            $(".photo-box ul").css("left",-148 * ($(".photo-box li").length - 1));
            $(".photo-box ul").animate(
                {
                    "left":-148 * ($(".photo-box li").length - 2)
                },500
            );
        }
    }
);
